package com.xiguaji.tiktok.task.blogger_test;

import com.xiguaji.tiktok.task.blogger.BloggerTask;
import com.xiguaji.tiktok.task.music.MusicTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: luolifeng
 * Date: 2020-10-15 20:09
 */
@RestController
public class ControllerTest {

    @Autowired
    BloggerTask bloggerTask;

    @Autowired
    MusicTask musicTask;
    @GetMapping("/blogger/{records}")
    public void ttt(@PathVariable int records){
        String taskString="{\"records\":"+records+",\"topic\":\"blogger_day\"}";
        bloggerTask.sendBlogger2kafkaHandler(taskString);
    }

    @GetMapping("/music/{records}")
    public void tt(@PathVariable int records){
        String taskString="{\"records\":"+records+",\"topic\":\"music_day\"}";
        musicTask.sendMusic2kafkaHandler(taskString);
    }

}
